#!/bin/bash

for ((i = 1; i <= 25; ++i)); do
	echo "----- q$i.ascii"
	time ./exec_plan $i queries/q$i.ascii | sort > queries/q$i.out
	if [ $? -eq 0 ]; then
		diff -q queries/q$i.out queries/q$i.expected
		if [ $? -eq 0 ]; then
			echo "SUCCESS"
		else
			echo "FAIL"
		fi
	else
		echo "FAIL"
	fi
done
